# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
pkgname=py3-astral
_pkgname=astral
pkgver=3.2
pkgrel=2
pkgdesc="Calculations for the position of the sun and moon"
url="https://pypi.org/project/astral"
arch="noarch"
license="Apache-2.0"
depends="python3 tzdata"
makedepends="py3-poetry-core py3-gpep517 py3-installer"
checkdepends="py3-pytest py3-freezegun"
subpackages="$pkgname-pyc"
source="$_pkgname-$pkgver.tar.gz::https://github.com/sffjunkie/astral/archive/$pkgver.tar.gz"
builddir="$srcdir"/$_pkgname-$pkgver

replaces=py-astral # Backwards compatibility
provides=py-astral=$pkgver-r$pkgrel # Backwards compatibility

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	# skip the webtest since we lack an API key
	pytest -v -m "not webtest"
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/astral-*.whl
}

sha512sums="
f463d58ecd2d251a5c9bbcc18a65d7234e596a6c4f8fdd29574049e5d6942cc3881da8e3851a052050b1e40db5db55fdd4967468b5f6bea2fa8ea597b0d65251  astral-3.2.tar.gz
"
